using System;
using System.Diagnostics;

/// <summary>
/// Summary description for Error Page.
/// </summary>
public partial class  APIError : System.Web.UI.Page
{
    private static TraceSource _source = new TraceSource("PayPal");
    private static TraceSource _sourceAPI = new TraceSource("PayPalAPI");

	private void Page_Load(object sender, System.EventArgs e)
	{
	    try
	    {

            _source.TraceEvent(TraceEventType.Error, 0, "API Error");

	    string strErrorCode = Request.QueryString["ErrorCode"];
        string strErrorDesc1 = Request.QueryString["Desc"];
        string strErrorDesc2 = Request.QueryString["Desc2"];

        _source.TraceEvent(TraceEventType.Start, 0, "API Error");
        _source.TraceEvent(TraceEventType.Information, 2, "In API ");
        _source.TraceEvent(TraceEventType.Error, 2, "API Error Code = '{0}', <br /> Desc1 = '{1}', <br /> Desc2 = '{Desc2}'", strErrorCode, strErrorDesc1, strErrorDesc2);
        _source.TraceEvent(TraceEventType.Stop, 2, "API Error");

        _source.TraceEvent(TraceEventType.Error, 2, "API Error Code = '{0}', <br /> Desc1 = '{1}', <br /> Desc2 = '{Desc2}'", strErrorCode, strErrorDesc1, strErrorDesc2);
        _sourceAPI.TraceEvent(TraceEventType.Error, 2, "API Error Code = '{0}', <br /> Desc1 = '{1}', <br /> Desc2 = '{Desc2}'", strErrorCode, strErrorDesc1, strErrorDesc2);
        _source.TraceEvent(TraceEventType.Information, 2, "In API ");

        }
        catch (Exception ex)
        {
            Response.Write("Exception " + ex.InnerException.ToString());
    
        }
    }

	#region Web Form Designer generated code
	override protected void OnInit(EventArgs e)
	{
		//
		// CODEGEN: This call is required by the ASP.NET Web Form Designer.
		//
		InitializeComponent();
		base.OnInit(e);
	}
	
	/// <summary>
	/// Required method for Designer support - do not modify
	/// the contents of this method with the code editor.
	/// </summary>
	private void InitializeComponent()
	{    
		this.Load += new System.EventHandler(this.Page_Load);
	}
	#endregion
}
